package top.hesisi.springboot3.entity;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import top.hesisi.springboot3.entity.auth.TbUser;
import top.hesisi.springboot3.validate.CommonValidate;

import java.io.Serial;
import java.io.Serializable;

@Data
@TableName("tb_contact")
public class TbContact implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private Integer uid;
    @NotBlank(message = "联系人姓名必须填写", groups = {CommonValidate.Add.class, CommonValidate.Edit.class})
    @Length(min = 2, message = "联系人姓名长度不能小于2", groups = {CommonValidate.Add.class, CommonValidate.Edit.class})
    private String username;
    @NotBlank(message = "联系人姓名必须填写", groups = {CommonValidate.Add.class, CommonValidate.Edit.class})
    @Length(min = 11, message = "联系人手机号长度不能小于11", groups = {CommonValidate.Add.class, CommonValidate.Edit.class})
    private String phone;
    private String email;
    private String address;

}
